package fun.boomcat.luckyhe.mirai.plugin.dougu.utils;

import fun.boomcat.luckyhe.mirai.plugin.dougu.pojo.Dougu;
import net.mamoe.mirai.console.command.CommandManager;

import java.util.ArrayList;
import java.util.List;

public class DouguCommandHelp {
    public static String helpStr(String primaryName, String[] secondaryNames) {
        String commandPrefix = CommandManager.INSTANCE.getCommandPrefix();

        StringBuilder sb = new StringBuilder();

        sb.append(commandPrefix).append(primaryName).append("指令 ");
        if (secondaryNames.length != 0) {
            sb.append("别名：");
            for (String secondaryName : secondaryNames) {
                sb.append(commandPrefix).append(secondaryName).append(" ");
            }
        }
        sb.append("\n");

        sb.append(commandPrefix).append(primaryName).append(" init（别名：初始化）    初始化数据库\n");

        return sb.toString();
    }

    public static List<Dougu> initDougus(String primaryName) {
        String commandPrefix = CommandManager.INSTANCE.getCommandPrefix();

        List<Dougu> dougus = new ArrayList<>();
        dougus.add(new Dougu(0, "占位卡", "仅仅拿来占位，并没有什么卵用。", commandPrefix + primaryName + " use 占位卡"));
        dougus.add(new Dougu(1, "十分钟禁言卡", "禁言某人十分钟。", commandPrefix + primaryName + " use 十分钟禁言卡 <@群成员>"));
        dougus.add(new Dougu(2, "三十分钟禁言卡", "禁言某人三十分钟。", commandPrefix + primaryName + " use 三十分钟禁言卡 <@群成员>"));
        dougus.add(new Dougu(3, "任意分钟禁言卡", "禁言某人任意分钟（最多60分钟）", commandPrefix + primaryName + " use 任意分钟禁言卡 <分钟数>"));
        return dougus;
    }
}
